﻿<Window x:Class="QuickZip.Dialogs.PasswordDialog"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" x:Name="root" Title=""
             d:DesignHeight="180" d:DesignWidth="300">
    <Window.Resources>
        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="Margin" Value="5" />
        </Style>
        <Style TargetType="{x:Type Button}">
            <Setter Property="Margin" Value="5" />
        </Style>
        <Style TargetType="{x:Type CheckBox}">
            <Setter Property="Margin" Value="5" />
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />  <!--Header-->            
            <RowDefinition Height="Auto" />  <!--Input-->                        
            <RowDefinition Height="Auto" />  <!--Cancel, OK-->
        </Grid.RowDefinitions>
        
        <TextBlock Grid.Row="0">
            Please enter password for the following item : 
        </TextBlock>
        
        <Grid VerticalAlignment="Center" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="20" />
                <ColumnDefinition Width="2*" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
                <RowDefinition /> <!--Save Password-->
            </Grid.RowDefinitions>

            <TextBlock Text="Archive Name:" Grid.Row="0" Grid.Column="0" TextAlignment="Right" />
            <TextBox Text="{Binding SourceName, ElementName=root}"  IsReadOnly="True" Grid.Row="0" Grid.Column="2" />
            
            <TextBlock Text="File Name:" Grid.Row="1" Grid.Column="0" TextAlignment="Right" />
            <TextBox Text="{Binding SourceName, ElementName=root}"  IsReadOnly="True" Grid.Row="1" Grid.Column="2" />

            <TextBlock Text="Password:" Grid.Row="2" Grid.Column="0" TextAlignment="Right" />
            <PasswordBox x:Name="pBox" PasswordChar="*" Grid.Row="2" Grid.Column="2" />
            
            <CheckBox x:Name="cPwd" Content="Remember password" Grid.Row="3" Grid.Column="2" />
        </Grid>
        
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="2">
            <Button x:Name="btnCancel" IsCancel="True" Content="Cancel" Click="btnCancel_Click" Width="80" />
            <Button x:Name="bOK" IsDefault="True" Content="OK" Click="bOK_Click" Width="80" />
        </StackPanel>
    </Grid>
</Window>
